#include "Sort.h"

void TestInsertSort()
{
	int arr[] = { 4, 7, 1, 9, 3, 6, 5, 8, 3, 2, 0 };
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
	InsertSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
}


void TestShellSort()
{
	int arr[] = { 4, 7, 1, 9, 3, 6, 5, 8, 3, 2, 0 };
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
	ShellSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestBubbleSort()
{
	int arr[] = { 4, 7, 1, 9, 3, 6, 5, 8, 3, 2, 0 };
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
	BubbleSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
}

void TestSelectSort()
{
	//int arr[] = { 3,5,1,6,9,0,8,2,4,7 };
	int arr[] = { 4, 7, 1, 9, 3, 6, 5, 8, 3, 2, 0};
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
	SelectSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
}


void TestQuickSort()
{
	//int arr[] = { 3,5,1,6,9,0,8,2,4,7 };
	int arr[] = { 4, 7, 1, 9, 3, 6, 5, 8, 3, 2, 0 };
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
	TestQuickSort(arr, sizeof(arr) / sizeof(arr[0]) - 1);
	PrintElem(arr, sizeof(arr) / sizeof(arr[0]));
}

int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestBubbleSort();
	//TestSelectSort();
	TestQuickSort();
	return 0;
}

